package com.duckygo.towerdefense;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class SplashScreenActivity extends Activity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splash);
		
		final int durataSplashScreen = 3000; // 3 secunde afiseaza SplashScreen
		
		Thread welcomeThread = new Thread() {

			int wait = 0;

			@Override
			public void run() {
				try {
					super.run();
					while (wait < durataSplashScreen) {
						sleep(100);
						wait += 100;
					}
				} catch (Exception e) {
					
				} finally {
					// Dupa ce expira timpul pentru SplashScreen afiseaza ecranul principal
					startActivity(new Intent(SplashScreenActivity.this,
							MainMenuActivity.class));
					finish(); 
				}
			}
		};
		welcomeThread.start();

	}
}